#include <iostream>
#include <cstdlib>
#define N 1000
using namespace std;
int dot_arr[N+1][2]={0};
char type_arr[N+1];
int main_34()
{
    int n,m,A_less_than_0,A_greater_than_0,B_less_than_0,B_greater_than_0;
    bool res;
    scanf("%d%d",&n,&m);
    for (int i=0; i<n ; i++ )
    {
        scanf("%d%d%s",&dot_arr[i][0],&dot_arr[i][1],&type_arr[i]);
    }
    int param_arr[m][3]= {0};
    for (int i=0; i<m ; i++ )
    {
        scanf("%d%d%d",&param_arr[i][0],&param_arr[i][1],&param_arr[i][2]);
    }
    for (int i=0; i<m ; i++ )
    {
        A_less_than_0=0,A_greater_than_0=0,B_less_than_0=0,B_greater_than_0=0;
        for (int j=0; j<n ; j++ )
        {
            res=(param_arr[i][0]+param_arr[i][1]*dot_arr[j][0]+param_arr[i][2]*dot_arr[j][1]>0);
            if (type_arr[j]=='A')
            {
                if (res)
                {
                    A_greater_than_0+=1;
                }
                else
                {
                    A_less_than_0+=1;
                }
            }
            else
            {
                if (res)
                {
                    B_greater_than_0+=1;
                }
                else
                {
                    B_less_than_0+=1;
                }
            }
        }
        if ((A_less_than_0==0&&B_greater_than_0==0)||(B_less_than_0==0&&A_greater_than_0==0))
        {
            printf("Yes\n");
        }
        else
        {
            printf("No\n");
        }
    }
    return 0;
}
